{layout name="admin/layout" /}

<div class="col-xs-12">
    <div class="page-header">
        <h1>{:v('headtitle')}</h1>
    </div>
    <button class="btn btn-success store" data-url="{:url('add')}" style="margin-bottom: 15px">新增栏目</button>
    <div class="table-responsive">
        <table id="sample-table-1" class="table table-striped table-bordered table-hover">
            <thead>
            <tr>
                <th class="center">
                    <label>
                        <input type="checkbox" class="ace"/>
                        <span class="lbl"></span>
                    </label>
                </th>
                <th>标题</th>
                <th>栏目等级</th>
                <th>图标</th>
                <th class="hidden-480">链接</th>
                <th class="hidden-480">排序</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>

            <tbody>
            {volist name='list' id='v'}
                <tr>
                    <td class="center">
                        <label>
                            <input type="checkbox" class="ace"/>
                            <span class="lbl"></span>
                        </label>
                    </td>
                    <td>{$v.title}</td>
                    <td>顶级栏目</td>
                    <td class="hidden-480"><i class="{$v.icon}"></i></td>
                    <td>{$v.url}</td>
                    <td class="hidden-480">
                        {$v.sort}
                    </td>
                    <td>{switch name='v.display'}{case value='0'}隐藏{/case}{case value='1'}显示{/case}{/switch}</td>
                    <td>
                        <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                            <button class="btn btn-xs btn-info store" data-url="{:url('edit',array('id'=>$v['id']))}">
                                <i class="icon-edit bigger-120"></i>
                            </button>

                            <button class="btn btn-xs btn-danger ajax" data-url="{:url('del',array('id'=>$v['id']))}">
                                <i class="icon-trash bigger-120"></i>
                            </button>
                        </div>
                    </td>
                </tr>
                {present name='v.children'}
                    {volist name="v.children" id='vv'}
                        <tr>
                            <td class="center">
                                <label>
                                    <input type="checkbox" class="ace"/>
                                    <span class="lbl"></span>
                                </label>
                            </td>
                            <td>&nbsp;┗━{$vv.title}</td>
                            <td>二级栏目</td>
                            <td class="hidden-480"><i class="{$vv.icon}"></i></td>
                            <td>{$vv.url}</td>
                            <td class="hidden-480">
                                {$vv.sort}
                            </td>
                            <td>{switch name='vv.display'}{case value='0'}隐藏{/case}{case value='1'}显示{/case}{/switch}</td>
                            <td>
                                <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                                    <button class="btn btn-xs btn-info store" data-url="{:url('edit',array('id'=>$vv['id']))}">
                                        <i class="icon-edit bigger-120"></i>
                                    </button>

                                    <button class="btn btn-xs btn-danger ajax" data-url="{:url('del',array('id'=>$vv['id']))}">
                                        <i class="icon-trash bigger-120"></i>
                                    </button>
                                </div>
                            </td>
                        </tr>
                        {present name='vv.children'}
                            {volist name="vv.children" id='vvv'}
                                <tr>
                                    <td class="center">
                                        <label>
                                            <input type="checkbox" class="ace"/>
                                            <span class="lbl"></span>
                                        </label>
                                    </td>
                                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;┗━{$vvv.title}</td>
                                    <td>三级栏目</td>
                                    <td class="hidden-480"><i class="{$vvv.icon}"></i></td>
                                    <td>{$vvv.url}</td>
                                    <td class="hidden-480">
                                        {$vvv.sort}
                                    </td>
                                    <td>{switch name='vvv.display'}{case value='0'}隐藏{/case}{case value='1'}显示{/case}{/switch}</td>
                                    <td>
                                        <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                                            <button class="btn btn-xs btn-info store" data-url="{:url('edit',array('id'=>$vvv['id']))}">
                                                <i class="icon-edit bigger-120"></i>
                                            </button>

                                            <button class="btn btn-xs btn-danger ajax" data-url="{:url('del',array('id'=>$vvv['id']))}">
                                                <i class="icon-trash bigger-120"></i>
                                            </button>
                                        </div>
                                    </td>
                                </tr>
                            {/volist}
                        {/present}
                    {/volist}
                {/present}
            {/volist}
            </tbody>
        </table>
    </div><!-- /.table-responsive -->
</div><!-- /span -->